<template>
  <div class="zhuti">
    <div class="box">
      <div class="boxInput">
        <div class="rig">
          <div>用户名称：</div>
          <div>
            <el-input v-model="input" placeholder="请输入商品名称" />
          </div>
          <el-button class="sou" :loading="true">搜索</el-button>
        </div>
      </div>
    </div>
    <div class="buttom">
      <!-- 表格 -->
      <div class="Tab">
        <el-table
          :data="tableData"
          style="width: 100%"
          height="60vh"
          :header-cell-style="{ background: '#f5f5f5' }"
        >
          <el-table-column
            prop="name"
            label="用户"
            min-width="120"
            class="TableC"
          />
          <el-table-column prop="state" label="商品" min-width="120" />
          <el-table-column prop="city" label="商品评分" min-width="120" />
          <el-table-column prop="address" label="评价内容" min-width="300" />
          <el-table-column prop="zip" label="评价图片" min-width="120" />
          <el-table-column prop="zip" label="状态" min-width="120" />
          <el-table-column prop="zip" label="评价时间" min-width="120" />
          <el-table-column fixed="right" label="操作" min-width="60">
            <template #default="scopee">
              <div class="bbox">
                <el-tooltip content="回复" placement="top">
                  <div class="reply" @click="huifu(scopee)">
                    <el-icon><ChatDotRound /></el-icon>
                  </div>
                </el-tooltip>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="paging">
        <el-pagination
          v-model:current-page="currentPage4"
          v-model:page-size="pageSize4"
          :page-sizes="[10, 20, 30, 50]"
          :background="true"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </div>
  </div>
  <chouti title="回复" size="40%" ref="hiuFuKeHu">
    <div class="xiugai">
      <div>回复内容：</div>
      <div class="elinp">
        <el-input v-model="nieRong" placeholder="请输入回复内容" />
      </div>
    </div>
    <div class="wei">
      <el-button type="success" :plain="true" @click="open1"
        >确定<el-icon><Check /></el-icon
      ></el-button>
      <el-button type="danger" @click="quxiao"
        >取消<el-icon><CloseBold /></el-icon
      ></el-button>
    </div>
  </chouti>
</template>

<script setup>
import chouti from "../../components/chouti.vue";
import { ref } from "vue";
import { ElMessage } from "element-plus";
const input = ref("");
const currentPage4 = ref(1);
const pageSize4 = ref(10);
const hiuFuKeHu = ref(null);
const nieRong = ref(``);
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-02",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Office",
  },
  {
    date: "2016-05-04",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Home",
  },
  {
    date: "2016-05-01",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
    tag: "Office",
  },
];
//   当显示几行改变时
function handleSizeChange() {}
// 页面改变
function handleCurrentChange(p) {}

//   回复
function huifu(row) {
  hiuFuKeHu.value.open();
}
// 确定
function open1() {
  if (!nieRong.value) {
    ElMessage({
      message: "提交失败",
      type: "error",
    });
  } else {
    ElMessage({
      message: "提交成功",
      type: "success",
    });
    hiuFuKeHu.value.close();
  }
}
// 取消
function quxiao() {
  hiuFuKeHu.value.close();
}
</script>

<style scoped>
.zhuti {
  background-color: #f5f5f5;
}
.box {
  display: flex;
  justify-content: space-between;
}

.boxInput > .rig {
  line-height: 40px;
  height: 40px;
  display: flex;
  border-radius: 5px;
  font-size: 14px;
}
.boxInput {
  width: 100%;
  margin-top: 10px;
  /* height: 76px; */
  padding: 15px 10px;
  border-radius: 10px;
  background-color: white;
}
.sou {
  margin-top: 7px;
  width: 70px;
  height: 32px;
  line-height: 30px;
  font-size: 12px;
  background-color: #ff6a6c;
  text-align: center;
  border-radius: 5px;
  margin-left: 10px;
  color: white;
}
.left > p > span {
  background-color: #ff6a6c;
  border-radius: 100px;
  padding: 2px 5px;
  font-size: 10px;
}
.buttom {
  padding: 2px;
  border-radius: 10px;
  color: white;
  margin-top: 30px;
  background-color: white;
}
.bbox {
  padding: 30px 0;
}
.reply {
  width: 30px;
  height: 30px;
  line-height: 30px;
  border: 1px solid black;
  border-radius: 50%;
  font-size: 20px;
  text-align: center;
  border: 1px #a9acb1 solid;
}
.reply:hover {
  background-color: #ff6a6c;
  color: white;
}
.paging {
  position: fixed;
  bottom: 20px;
}
.xiugai {
  display: flex;
  margin-bottom: 20px;
}
.elinp {
  width: 80%;
}
.wei {
  width: 90%;
  display: flex;
  justify-content: space-between;
  position: absolute;
  bottom: 10px;
}
</style>
